package com.zoe.onelink.auth.runner;

import cn.hutool.cron.CronUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2018</p>
 * <p>公司: 智业软件</p>
 *
 * @author LinHongKai
 * @date 2022-03-18 14:57
 */
@Slf4j
public class RedisCompareRunner implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) throws Exception {
        RedisCompareTask task = new RedisCompareTask();
        String schedulerId = CronUtil.schedule("*/1 * * * * *", task);
        task.setSchedulerId(schedulerId);
        // 定时执行
        CronUtil.start();
    }
}
